package com.example.demo.service;

import com.example.demo.dao.TestDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description
 * @Author wangzi
 * @Date 2019/4/30 14:00
 */
@Service
public class JoinActivityService {

    @Autowired
    private TestDao testDao;

    public int insertJoin(){
        ArrayList<Map> list = new ArrayList<>();
        //生成数据
        for (int i=0;i<1999; i++) {
            HashMap<Object, Object> map = new HashMap<>();
            int num = (int) (Math.random() * (9999 - 1000 + 1)) + 1000;
            map.put("phoneStar","176****" + num);
            map.put("phone", "1760000" + num);
            list.add(map);
        }
        for (Map map:list) {
            System.out.println(map);
        }
        return testDao.insertJoin(list);
    }


}
